package com.singleton.pattern.singleton.demo;

/**
 * @Classname HungrySingleton
 * @Description 饿汉模式(静态加载)
 * @Date 2019/11/20 0020 15:23
 * @Created by 埔枘
 */
public class HungrySingleton2 {

    private static final HungrySingleton2 hungrySingleton;

    static{
        hungrySingleton = new HungrySingleton2();
    }
    /**
     * 私有化 空构造
     */
    private HungrySingleton2(){}

    public static HungrySingleton2 getSingleton(){
        return hungrySingleton;
    }
}
